package com.gameObjects;

import android.graphics.Rect;

import com.badlogic.androidgames.framework.gl.Animation;
import com.badlogic.androidgames.framework.gl.SpriteBatcher;
import com.badlogic.androidgames.framework.gl.TextureRegion;
import com.badlogic.androidgames.framework.math.Rectangle;
import com.badlogic.androidgames.framework.math.Vector2;

public abstract class GameObject
{
	public Vector2 position = new Vector2(), size = new Vector2();
	public Rectangle bounds;
	public String tag;
	public TextureRegion image;
	public Animation animation;
	
	public GameObject (float x, float y, float w, float h)
	{
		position = new Vector2(x,y);
		bounds = new Rectangle(position.x - w/2, this.position.y - h/2 , w,  h);
		tag = "undefined";
	}
	
	public GameObject()
	{
		
	}
	
	public void Update(float deltaTime)
	{
		bounds.lowerLeft.set(position).sub(bounds.width / 2, bounds.height / 2);
	}
	public abstract void Draw(SpriteBatcher batcher);
	
	public float GetX(){ return position.x;}
	public float GetY(){ return position.y;}
	public float GetW(){ return bounds.width;}
	public float GetH(){ return bounds.height;}
	
	public void SetX(float x){this.position.x = x;}
	public void SetY(float y){this.position.y = y;}
	public void SetW(float w){this.size.x = w;}
	public void SetH(float h){this.size.y = h;}
}
